﻿using ArtMath.Core.Data;
using System;
using System.Collections.Generic;

namespace ArtMath.PointCollection
{
    [Serializable]
    public class Universal : ContinuityPoint
    {
        public static readonly Universal Instance = new Universal();
        public Universal()
        {

        }
        public Universal(params PointD[] exceptPoints)
        {
            Exceptions = new HashSet<PointCollectionBase>() { new DiscontinuityPoint(exceptPoints) };
        }
        public Universal(PointD location, double k)
        {
            Exceptions = new HashSet<PointCollectionBase> { new StraightLine(location, k) };
        }
        public override bool Contains(PointD pt)
        {
            return AfterContains(pt);
        }

        public override PointD? GetNearestPoint(PointD pt)
        {
            return pt;
        }
        protected override PointCollectionBase Intersect(PointCollectionBase collection)
        {
            return AfterIntersect(collection);
        }
        public static PointCollectionBase[] GenerateInstanceArray()
        {
            return new PointCollectionBase[] { new Universal() };
        }
    }
}
